home *** CD-ROM | disk | FTP | other *** search
- property module, userArea, usedList, soundList, musicStart, musicTime, musicChoice
-
- on new me
- set the userArea of me to #empty
- set the usedList of me to [#main: [#video: 0], #menu1: [#menu1: 0, #myself: 0, #measure: 0, #history: 0, #mirror: 0], #menu2: [#menu2: 0, #dm101: 0, #reach4: 0, #stepfar: 0, #view: 0], #menu3: [#menu3: 0, #dm202: 0, #meeting: 0, #candles: 0, #whowhat: 0], #menu4: [#menu4: 0, #review: 0, #plan: 0, #eval: 0, #video: 0]]
- set the soundList of me to [#main: [], #menu1: [], #menu2: [], #menu3: [], #menu4: []]
- set the musicChoice of me to 1
- return me
- end
-
- on setModule me, thisModule
- set the module of me to thisModule
- end
-
- on setUserArea me, thisActivity
- set the userArea of me to thisActivity
- end
-
- on getUserArea me
- return the userArea of me
- end
-
- on setSoundList me, thisList
- if getProp(the soundList of me, the module of me) = [] then
- setProp(the soundList of me, the module of me, thisList)
- end if
- end
-
- on activate me, thisArea
- set vParams to the paramCount
- case vParams of
- 1:
- setProp(getProp(the usedList of me, the module of me), the userArea of me, 1)
- 2:
- setProp(getProp(the usedList of me, the module of me), thisArea, 1)
- end case
- end
-
- on iAmActivated me
- return getProp(getProp(the usedList of me, the module of me), the userArea of me)
- end
-
- on activationOn me, thisArea, thisModule
- set vParams to the paramCount
- case vParams of
- 2:
- return getProp(getProp(the usedList of me, the module of me), thisArea)
- 3:
- return getProp(getProp(the usedList of me, thisModule), thisArea)
- end case
- end
-
- on goNarrator me, thisItem
- sound playFile 2, "@//Media/Sound/" & thisItem & ".aif"
- end
-
- on diskAudio me, thisItem
- sound playFile 2, "@//Media/Sound/" & thisItem & ".aif"
- end
-
- on audio1xOnly me, thisItem
- if getPos(getProp(the soundList of me, the module of me), thisItem) = 0 then
- sound playFile 2, "@//Media/Sound/" & thisItem & ".aif"
- add(getProp(the soundList of me, the module of me), thisItem)
- end if
- end
-
- on clearSoundUsage me, stringList
- repeat with vSound in stringList
- deleteOne(getProp(the soundList of me, the module of me), vSound)
- end repeat
- end
-
- on checkMusic me
- if not (the musicChoice of me) then
- exit
- end if
- if not soundBusy(2) then
- bkgrdMusic(me)
- end if
- end
-
- on bkgrdMusic me
- if not (the musicChoice of me) then
- exit
- end if
- set thisItem to #empty
- case the module of me of
- #main:
- set thisItem to "Trac25"
- #menu1:
- case the userArea of me of
- #menu1:
- set thisItem to "Trac28b"
- #myself:
- set thisItem to "Trac35t"
- #measure:
- set thisItem to "Trac32w"
- #history:
- set thisItem to "Trac29l"
- #mirror:
- set thisItem to "Trac30a"
- end case
- #menu2:
- case the userArea of me of
- #menu2:
- set thisItem to "Trac28b"
- #dm101:
- set thisItem to "Trac31s"
- #reach4:
- set thisItem to "Trac39f"
- #stepfar:
- set thisItem to "Trac33s"
- #view:
- set thisItem to "Trac34i"
- end case
- #menu3:
- case the userArea of me of
- #menu3:
- set thisItem to "Trac28b"
- #dm202:
- set thisItem to "Trac31s"
- #meeting:
- set thisItem to "Trac32w"
- #candles:
- set thisItem to "Trac37l"
- #whowhat:
- set thisItem to "Trac36m"
- end case
- #menu4:
- set thisItem to "Trac31s"
- case the userArea of me of
- #menu4:
- set thisItem to "Trac31s"
- #review:
- set thisItem to "Trac28b"
- #plan:
- set thisItem to "Trac32w"
- #eval:
- set thisItem to "Trac37l"
- end case
- end case
- if thisItem <> #empty then
- musicSpecs(me, thisItem)
- sound playFile 2, "@//Media/" & thisItem & ".aif"
- end if
- end
-
- on musicSpecs me, trackName
- case trackName of
- "Trac25":
- set the musicTime of me to 60 * 130
- "Trac27g":
- set the musicTime of me to 60 * 70
- "Trac28b":
- set the musicTime of me to 60 * 305
- "Trac29l":
- set the musicTime of me to 60 * 82
- "Trac30a":
- set the musicTime of me to 60 * 123
- "Trac31s":
- set the musicTime of me to 60 * 108
- "Trac32w":
- set the musicTime of me to 60 * 99
- "Trac33s":
- set the musicTime of me to 60 * 241
- "Trac34i":
- set the musicTime of me to 60 * 65
- "Trac35t":
- set the musicTime of me to 60 * 123
- "Trac37l":
- set the musicTime of me to 60 * 122
- "Trac39f":
- set the musicTime of me to 60 * 60
- end case
- set the musicStart of me to the ticks
- end
-
- on switchMusic me
- if the musicChoice of me then
- set the musicChoice of me to 0
- if soundBusy(2) then
- sound stop 2
- end if
- else
- set the musicChoice of me to 1
- end if
- end
-
- on showProperties me
- put "module:" && the module of me
- put "userArea:" && the userArea of me
- put "usedList:" && the usedList of me
- put "soundList:" && the soundList of me
- end
-